{include file="public/header" /}
<body class="gray-bg">
<div class="wrapper wrapper-content">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>编辑船型</h5>
                </div>
                <div class="ibox-content layui-form">
                    <div class="layui-row layui-col-space10 layui-form-item ">

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">船型名称：</label>
                            <div class="layui-input-block">
                                <input type="text" name="boat_name" lay-verify="required" placeholder="船型名称" class="layui-input" value="{$boat.boat_name}">
                            </div>
                        </div>

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">船长（m）：</label>
                            <div class="layui-input-block">
                                <input type="text" name="boat_long" lay-verify="required" placeholder="船长" class="layui-input" oninput="value=value.replace(/[^\d.]/g,'')" value="{$boat.boat_long}">
                            </div>
                        </div>

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">缩略图：</label>
                            <input type="hidden" name="boat_thumb" id="lay-img" lay-verify="image">
                            <div class="layui-input-block">
                                <div id="lay-upload">上传图片</div>
                                <blockquote class="layui-elem-quote layui-quote-nm" style="margin-top: 10px;">
                                    预览图：
                                    <div class="layui-upload-list" id="lay-list">
                                        <img class="layui-append-img" src="{$boat.boat_thumb}" onerror="this.src='/static/admin/images/no_img.jpg'">
                                    </div>
                                </blockquote>
                            </div>
                        </div>

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">世界航行状况：</label>
                            <div class="layui-input-block">
                                <input type="text" name="boat_sail_state" placeholder="世界航行状况" class="layui-input" value="{$boat.boat_sail_state}">
                            </div>
                        </div>

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">上市时间：</label>
                            <div class="layui-input-block">
                                <input type="text" name="boat_up_time" placeholder="上市时间" class="layui-input" value="{$boat.boat_up_time}">
                            </div>
                        </div>

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">类型：</label>
                            <div class="layui-input-block">
                                <input type="text" name="boat_cate" placeholder="类型" class="layui-input" value="{$boat.boat_cate}">
                            </div>
                        </div>

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">船员人数：</label>
                            <div class="layui-input-block">
                                <input type="text" name="boat_person_num" placeholder="船员人数" class="layui-input" value="{$boat.boat_person_num}">
                            </div>
                        </div>

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">建议船员体重（Kg）：</label>
                            <div class="layui-input-block">
                                <input type="text" name="boat_weight" placeholder="建议船员体重" class="layui-input" value="{$boat.boat_weight}">
                            </div>
                        </div>

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">民族血统：</label>
                            <div class="layui-input-block">
                                <input type="text" name="boat_xuet" placeholder="民族血统" class="layui-input" value="{$boat.boat_xuet}">
                            </div>
                        </div>

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">船体材质：</label>
                            <div class="layui-input-block">
                                <input type="text" name="boat_caizhi" placeholder="船体材质" class="layui-input" value="{$boat.boat_caizhi}">
                            </div>
                        </div>

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">设计年份：</label>
                            <div class="layui-input-block">
                                <input type="text" name="boat_year" placeholder="设计年份" class="layui-input" value="{$boat.boat_year}">
                            </div>
                        </div>

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">船体宽度：</label>
                            <div class="layui-input-block">
                                <input type="text" name="boat_width" placeholder="船体宽度" class="layui-input" value="{$boat.boat_width}">
                            </div>
                        </div>

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">主帆面积：</label>
                            <div class="layui-input-block">
                                <input type="text" name="boat_mianji" placeholder="主帆面积" class="layui-input" value="{$boat.boat_mianji}">
                            </div>
                        </div>

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">前帆面积：</label>
                            <div class="layui-input-block">
                                <input type="text" name="boat_qian_mianji" placeholder="前帆面积" class="layui-input" value="{$boat.boat_qian_mianji}">
                            </div>
                        </div>

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">大三角帆面积：</label>
                            <div class="layui-input-block">
                                <input type="text" name="boat_sanjiao_mianji" placeholder="大三角帆面积" class="layui-input" value="{$boat.boat_sanjiao_mianji}">
                            </div>
                        </div>

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">迎风帆面积：</label>
                            <div class="layui-input-block">
                                <input type="text" name="boat_yinf_mianji" placeholder="迎风帆面积" class="layui-input" value="{$boat.boat_yinf_mianji}">
                            </div>
                        </div>

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">悬吊船员：</label>
                            <div class="layui-input-block">
                                <input type="text" name="boat_xuandiao" placeholder="悬吊船员" class="layui-input" value="{$boat.boat_xuandiao}">
                            </div>
                        </div>

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">船体重量：</label>
                            <div class="layui-input-block">
                                <input type="text" name="boat_chuanti_weight" placeholder="船体重量" class="layui-input" value="{$boat.boat_chuanti_weight}">
                            </div>
                        </div>

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">船只总质量：</label>
                            <div class="layui-input-block">
                                <input type="text" name="boat_total_weight" placeholder="船只总质量" class="layui-input" value="{$boat.boat_total_weight}">
                            </div>
                        </div>

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">排水量：</label>
                            <div class="layui-input-block">
                                <input type="text" name="boat_paishui" placeholder="排水量" class="layui-input" value="{$boat.boat_paishui}">
                            </div>
                        </div>

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">涉水深度：</label>
                            <div class="layui-input-block">
                                <input type="text" name="boat_sheshui" placeholder="涉水深度" class="layui-input" value="{$boat.boat_sheshui}">
                            </div>
                        </div>

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">设计师：</label>
                            <div class="layui-input-block">
                                <input type="text" name="boat_designer" placeholder="设计师" class="layui-input" value="{$boat.boat_designer}">
                            </div>
                        </div>

                        <input type="hidden" name="boat_id" value="{$boat_id}">

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <div class="layui-input-block">
                                <button class="layui-btn" lay-submit="" lay-filter="component-form-element">保存
                                </button>
                                <button class="layui-btn layui-btn-primary" onclick="history.go(-1)">关闭</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
{include file="public/footer" /}
<script>
    wk.uploadImg({size:5,type:'png,jpg,jpeg',url:"{:url('Upload/upload')}",domain:""});
    layui.use(['form','upload','layedit'], function() {
        var form = layui.form;
        form.on('submit(component-form-element)', function (data) {
            $('.layui-btn').addClass('layui-disabled').attr('disabled','disabled');
            $.ajax({
                url:"{:url('boatEdit')}",
                type:'post',
                dataType:'json',
                data:data.field,
                success:function(res){
                    if (res.code == 200) {
                        wk.success(res.msg,"{:url('Matchset/index')}")
                    } else {
                        wk.error(res.msg,'','$(".layui-btn").removeClass(\'layui-disabled\').removeAttr(\'disabled\');');
                    }
                }
            })
        });
    });
</script>

</body>
</html>
